From 3c5a4da7f2440543e95163cbf6784557090b8f68 Mon Sep 17 00:00:00 2001 From: "cl349@arcadians.cl.cam.ac.uk" Date: Wed, 24 Nov 2004 19:21:58 +0000 Subject: [PATCH] bitkeeper revision 1.1159.189.6 (41a4df56fjKgjR75gUVniMEBSnS-9Q) Unlock biglock on hypercall preemption. --- xen/arch/x86/memory.c | 2 +- xen/arch/x86/traps.c | 3 ++- xen/include/xen/sched.h | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index 4068583821..b62f9c37e0 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -1307,7 +1307,7 @@ int do_mmu_update(mmu_update_t *ureqs, int count, int *success_count) for ( i = 0; i < count; i++ ) { - hypercall_may_preempt( + locked_hypercall_may_preempt(d, __HYPERVISOR_mmu_update, 3, ureqs, count-i, success_count); if ( unlikely(__copy_from_user(&req, ureqs, sizeof(req)) != 0) ) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index c3a6453e7e..ca69d6589f 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -814,7 +814,8 @@ long do_set_trap_table(trap_info_t *traps) for ( ; ; ) { - hypercall_may_preempt(__HYPERVISOR_set_trap_table, 1, traps); + locked_hypercall_may_preempt(current->domain, + __HYPERVISOR_set_trap_table, 1, traps); if ( copy_from_user(&cur, traps, sizeof(cur)) ) return -EFAULT; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 9224699445..d69e3bf40e 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -263,6 +263,13 @@ void hypercall_create_continuation(unsigned int op, unsigned int nr_args, ...); hypercall_create_continuation(_op , _nr_args , ##_args); \ return _op; \ } } while ( 0 ) +#define locked_hypercall_may_preempt(_d, _op, _nr_args, _args...) \ + do { \ + if ( unlikely(softirq_pending(smp_processor_id())) ) { \ + hypercall_create_continuation(_op , _nr_args , ##_args); \ + UNLOCK_BIGLOCK(_d); \ + return _op; \ + } } while ( 0 ) /* This domain_hash and domain_list are protected by the domlist_lock. */ #define DOMAIN_HASH_SIZE 256 -- 2.30.2